<?php include '../templates/hibiscus/common/header.html';?>
<div class="layui-container fly-marginTop">

<?php if($code>1):?>
		<div class="fly-panel fly-panel-user" pad20>
			<div class="layui-card-header layui-hide-xs">支付订单</div>
			<blockquote class="layui-elem-quote">
				<ul class="layui-form">
					<li class="layui-form-li" style="line-height: 26px;">
						<div><p><?php echo $msg;?></p></div>
					</li>
				</ul>
			</blockquote>
			<p style="margin-bottom: 0;text-align:center"><a class="layui-btn layui-btn-warm" href="/product">返回</a></p>
		</div>
<?php else:?>
		<?php if(isset($order) AND !empty($order)):?>
		<div class="fly-panel fly-panel-user layui-hide-xs" pad20>
			<div class="layui-card-header">支付订单</div>
            <div class="layui-tab-item layui-show">
				<div class="layui-table-zlkb">
							<table class="layui-table" id="query-table">
								<colgroup>
									<col width="150">
									<col width="200">
									<col>
								</colgroup>
								<thead>
									<tr>
										<th>订单ID</th>
										<th>订单名称</th>
										<th>单价</th>
										<th>数量</th>
										<th>金额</th>
										<th>下单时间</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>
											<?php echo $order['orderid'];?>
										</td>
										<td>
											<?php echo $order['productname'];?>
										</td>
										<td>
											<?php echo $order['price'];?>
										</td>
										<td>
											<?php echo $order['number'];?>
										</td>
										<td>
											<?php echo $order['money'];?>
										</td>
										<td>
											<?php echo date('Y-m-d H:i:s',$order['addtime']);?>
										</td>
									</tr>
								</tbody>
							</table>
					</div>
				</div>
			</div>
				
				
			<div class="fly-panel fly-panel-user layui-hide-lg layui-hide-md layui-hide-sm">	
				<div class="layui-card layui-form-pane">
					<div class="layui-card-header">支付订单</div>
					<div class="layui-card-body" id="prodcut_num">
						<form class="layui-form" action="">
							<div class="layui-form-item">
								<label class="layui-form-label">订单</label>
								<div class="layui-input-block">
									<input type="text" value="<?php echo $order['orderid'];?>" readonly disabled class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">商品</label>
								<div class="layui-input-block">
									<input type="text" value="<?php echo $order['productname'];?>" readonly disabled class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">单价</label>
								<div class="layui-input-block">
									<input type="number" value="<?php echo $order['price'];?>" readonly disabled class="layui-input" >
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">数量</label>
								<div class="layui-input-block">
									<input type="text" value="<?php echo $order['number'];?>" readonly disabled class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">金额</label>
								<div class="layui-input-block">
									<input type="text" value="<?php echo $order['money'];?>" readonly disabled class="layui-input">
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<?php endif;?>

			<div class="fly-panel" id="query-pane" style="margin-top:-20px;padding-bottom: 20px;">
				<?php if($order['status']>0):?>
					<p style="margin-bottom: 0;text-align:center"><button class="layui-btn layui-btn-warm">已支付</button><button class="layui-btn view_kami" data-orderid="<?php echo $order['orderid'];?>">查看卡密</button></p>
				<?php else:?>
					<?php if(!empty($payments)):?>
						<div class="layui-tab-content">
							<div class="layui-tab-item layui-show">
								<div class="layui-form-pane">
									<div class="layerPay" id="layerPay" style="margin-bottom: 0;text-align:center">
										<input type="hidden" id="oid" value="<?php echo base64_encode($order['orderid']);?>">
										<?php foreach($payments AS $payment):?>
											<?php if($payment['active']>0):?><a class="orderpaymethod" data-type="<?php echo $payment['alias'];?>"><img src="<?php echo $payment['payimage'];?>"></a><?php endif;?>
										<?php endforeach;?>
									</div>
								</div>
							</div>
						</div>
					<?php else:?>
						<blockquote class="layui-elem-quote">站长正在加紧配置，请耐心等待....</blockquote>
					<?php endif;?>
				<?php endif;?>
			</div>	

<?php endif;?>
	
<!--引入公共底文件-->
<?php include '../templates/hibiscus/common/footer.html';?>
<script>
layui.use('productpay');
</script>